package com.quanyan.place.service;

import com.quanyan.api.APIResponse;
import com.quanyan.common.Plugin.PageObj;
import com.quanyan.place.entity.ReqAdminUserVo;
import com.quanyan.place.entity.TbAcResource;
import com.quanyan.place.entity.TbAcRole;
import com.quanyan.place.entity.TbAdminUser;
import com.quanyan.place.entity.TbDepartment;
import com.quanyan.place.entity.vo.AdminUserVo;

import java.util.List;

/**
 * Created by yangyun on 16-6-22.
 */
public interface AdminUserService {

    int saveAdminUser(AdminUserVo adminUserVo);

    int updateUserPassword(AdminUserVo adminUserVo);

    TbAdminUser getAdminUser(Integer uid);

    List<TbDepartment> getDeptList(Integer parentId);

    PageObj<List<TbAdminUser>> getAdminUserList(ReqAdminUserVo reqAdminUserVo);

    APIResponse userPasswordUpdate(Integer id, String oldPassword, String newPassword, String rePassword);

    AdminUserVo getAdminUserById(Integer id);

    void updateUserInfo(AdminUserVo aVo);

    boolean existsUser(AdminUserVo adminUserVo);

    /**
     * 获取未授权的供应商用户
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageObj<List<TbAdminUser>> getSupplierUserList(Integer pageNum, Integer pageSize,Integer groupId);
    
    /**
     * 获取用户可以访问的资源
     * @param userId
     * @return
     */
    List<TbAcResource>   getUserResource(Integer userId);
    
    List<TbAcRole>  getRoles(TbAcRole tbAcRole);
    
    List<TbAcResource> getAllResources();
    
    List<TbAcResource> getResourceByRole(Integer roleId);
    
    List<TbAcRole> getRoleByUser(Integer userId);
    
    void saveAdminPermission(Integer roleId,List<Integer> permissionId);
    
    void saveAdminRole(TbAcRole tbAcRole);
    
}
